package com.zhongfl.crm.enums.boss;

import lombok.Getter;

/**
 * @author 木叶丸
 * @date 2018/8/19 21:33
 */
@Getter
public enum ChannelSize {

    /**
     * 渠道规模
     */
    NOT_KNOW("不知道", 2671150),
    UNDER_TEN("<10人", 2450709),
    TEN_TO_TWENTY("10-20人", 2450710),
    TWENTY_TO_FIFTY("20-50人", 2450711),
    FIFTY_TO_ONE_HUNDRED("50-100人", 2450712),
    ONE_HUNDRED_TO_FIVE_HUNDRED("100-500人", 2450713),
    OVER_FIVE_HUNDRED("500人以上", 2450714),
    OTHER("", 0);

    private String sizeName;

    private Integer sizeId;

    ChannelSize(String sizeName, Integer sizeId) {
        this.sizeName = sizeName;
        this.sizeId = sizeId;
    }

    public static ChannelSize getEnumBySizeName(String sizeName) {
        for (ChannelSize item : ChannelSize.values()) {
            if (item.getSizeName().equals(sizeName)) {
                return item;
            }
        }
        return OTHER;
    }

    public static ChannelSize getEnumBySizeId(Integer sizeId) {
        for (ChannelSize item : ChannelSize.values()) {
            if (item.getSizeId().equals(sizeId)) {
                return item;
            }
        }
        return OTHER;
    }

}
